package com.woniuxy.controller;

import com.woniuxy.entity.Emp;
import com.woniuxy.service.EmpService;
import com.woniuxy.util.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("emp")
public class EmpController {
    @Autowired
    private EmpService empService;

    @PostMapping("save")
    public ResultVo save(@RequestBody Emp emp){
        int rows = empService.save(emp);
        return rows > 0 ? ResultVo.success() : ResultVo.failure();
    }
}
